import 'package:flutter/widgets.dart';
import 'package:mobile_app.core/core/domain/entities/learning_content/collection_list_item/collection_list_item.dart';

String getCollectionLocalizedTitle({
  required Collection collection,
  required BuildContext context,
}) {
  if (collection is InbuiltCollection) {
    final languageCode = Localizations.localeOf(context).languageCode;
    return collection.titles[languageCode]!;
  }

  if (collection is CustomCollection) {
    return collection.title;
  }

  throw UnimplementedError();
}